package Temp.杂乱无章;

import java.util.Scanner;
public class 求和1 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int[] arr = new int[n];
        long sum = 0l;

        for (int i = 0; i < arr.length; i++) {
            arr[i] = scanner.nextInt();
            sum += arr[i];
        }

        long res = sum * sum;
        for (int i = 0; i < arr.length; i++) {
            res -= arr[i] * arr[i];
        }
        System.out.println(res / 2);
    }
}
